﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

namespace UniEventDispatcher
{
	public class Notification
	{
		/// <summary>
		/// 通知发送者	
		/// </summary>
		public GameObject sender;

		/// <summary>
		/// 通知内容
		/// 发送消息的时候需要装箱、解析消息的时候需要拆箱
		/// </summary>
		public object param;

		/// <summary>
		/// 构造函数
		/// </summary>
		/// <param name="sender">通知发送者</param>
		/// <param name="param">通知内容</param>
		public Notification(GameObject sender, object param)
		{
			this.sender = sender;
			this.param = param;
		}

		/// <summary>
		/// 构造函数
		/// </summary>
		/// <param name="param"></param>
		public Notification(object param)
		{
			this.sender = null;
			this.param = param;
		}

		/// <summary>
		/// 实现ToString方法
		/// </summary>
		/// <returns></returns>
		public override string ToString()
		{
			return string.Format("sender={0},param={1}", this.sender, this.param);
		}
	}
}
